﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/Site1.Master" AutoEventWireup="true" CodeBehind="Master_Subject.aspx.cs" Inherits="ES_Project.Pages.WebForm8" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
table{font-size:inherit;margin-top: 0px;
    color: #000000;
}
TABLE {
	MARGIN-BOTTOM: 0px
}
        .style4
        {
            width: 1167px;
        }
    .DNNAlignright {
	TEXT-ALIGN: right
}
select,input,button,textarea,button{font:99% arial,helvetica,clean,sans-serif;}
INPUT {
	FONT: 700 small normal normal arial, helvetica, clean, sans-serif; COLOR: #057cc4; MARGIN-LEFT: 0px; MARGIN-RIGHT: 0px;
    text-align: left;
}
SELECT {
	FONT: 700 small normal normal arial, helvetica, clean, sans-serif; COLOR: #057cc4; MARGIN-LEFT: 0px; MARGIN-RIGHT: 0px
}
TEXTAREA {
	FONT: 700 small normal normal arial, helvetica, clean, sans-serif; COLOR: #057cc4; MARGIN-LEFT: 0px; MARGIN-RIGHT: 0px
}
TH {
	FONT-FAMILY: Tahoma, Arial, Helvetica; COLOR: #003366; FONT-SIZE: 12px; VERTICAL-ALIGN: baseline; FONT-WEIGHT: bold
}
        .style15
        {
            width: 100%;
        }
        .style19
        {
            width: 47px;
        }
        .style20
        {
            width: 1167px;
            font-size: small;
        }
        .style24
        {
            font-size: small;
            font-weight: bold;
            text-align: right;
            width: 95px;
        }
        .style25
        {
            width: 230px;
        }
        .style27
        {
            width: 207px;
        }
        .style31
        {
            font-size: small;
            text-align: right;
            width: 86px;
        }
        .style33
        {
            width: 1172px;
            height: 45px;
        }
        .style34
        {
            width: 47px;
            height: 45px;
        }
        .style36
        {
            width: 18px;
            height: 45px;
        }
        .style37
        {
            width: 18px;
        }
        .style38
        {
            font-size: small;
            text-align: right;
            width: 220px;
        }
        .style42
        {
            color: #FF3300;
        }
        .style43
        {
            color: #FF0000;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
 

        <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <script type ="text/javascript">
        function validate() {

            if (document.getElementById("ContentPlaceHolder1_clsRegCode").value == "") {
                alert("กรุณาระบุรหัสวิชา");
                //document.getElementById("AgentCode").focus();
                return (false);
            }
            if (document.getElementById("ContentPlaceHolder1_clsName").value == "") {
                alert("กรุณาระบุรหัสชื่อวิชา");
               // document.getElementById("ContentPlaceHolder1_clsRegId").focus();
                return (false);
            }



            return true;

        }
        </script>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table cellpadding="0" cellspacing="0" class="style2">
                <tr>
                    <td class="style36">
                        </td>
                    <td class="style33">
                        <strong>บันทึกวิชาเรียน</strong></td>
                    <td class="style34">
                        </td>
                </tr>
                <tr>
                    <td class="style37">
                        &nbsp;</td>
                    <td class="style4">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style37">
                        &nbsp;</td>
                    <td class="style4">
                        <table cellpadding="0" cellspacing="0" class="style15">
                            <tr>
                                <td class="style38">
                                    <strong style="text-align: right">รหัสวิชา :</strong></td>
                                <td class="style25">
                                    <asp:TextBox ID="clsRegId" runat="server" style="display:none"></asp:TextBox>
                                    <asp:TextBox ID="clsRegCode" runat="server" Width="120px"></asp:TextBox>
                                    <span class="style42">*</span>
                                </td>
                                <td class="style31">
                                    <strong>ชื่อวิชา :</strong></td>
                                <td class="style27">
                                    <asp:TextBox ID="clsName" runat="server" Width="120px"></asp:TextBox>
                                    <span class="style43">*</span>
                                </td>
                                <td class="style24">
                                    ระดับ :</td>
                                <td>
                                    <asp:TextBox ID="level" runat="server" Width="120px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style38">
                                    &nbsp;</td>
                                <td class="style25">
                                    &nbsp;</td>
                                <td class="style31">
                                    &nbsp;</td>
                                <td class="style27">
                                    &nbsp;</td>
                                <td class="style24">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style38">
                                    &nbsp;</td>
                                <td class="style25">
                                    &nbsp;</td>
                                <td class="style31">
                                    &nbsp;</td>
                                <td class="style27">
                                    &nbsp;</td>
                                <td class="style24">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style38">
                                    &nbsp;</td>
                                <td class="style25">
                                    <asp:Button ID="CMD_INSERT" runat="server" Text="  บันทึก " 
                                        Width="55px" OnClick="CMD_INSERT_Click" OnClientClick = "return validate()"/>
                                    &nbsp;<asp:Button ID="CMD_EDIT" runat="server" Text="แก้ไข" OnClick="CMD_INSERT_Click" OnClientClick = "return validate()"/>
                                    &nbsp;<asp:Button ID="CMD_CLEAR" runat="server" Text="เคลียร์" OnClick="CMD_CLEAR_Click"/>
                                </td>
                                <td class="style31">
                                    &nbsp;</td>
                                <td class="style27">
                                    &nbsp;</td>
                                <td class="style24">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style37">
                    </td>
                    <td class="style4">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style37">
                        &nbsp;</td>
                    <td class="style20">
                        <strong>แสดงข้อมูลวิชาเสริม</strong></td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style37">
                        &nbsp;</td>
                    <td class="style4">
                        <asp:GridView ID="GridView4" runat="server" AutoGenerateColumns="False" 
                            border="1" CellPadding="4" ForeColor="#333333" GridLines="None" Width="100%"
                             DataKeyNames="cls_reg_id" OnRowDataBound ="GridView4_RowDataBound" 
                             OnSelectedIndexChanged="GridView4_SelectedIndexChanged" 
                            onrowdeleting="GridView4_RowDeleting">
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:TemplateField HeaderText="ลำดับ">
                                    <ItemTemplate>
                                       <%#Container.DataItemIndex+1 %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField Visible="false">
                                    <ItemTemplate>
                                       <asp:HiddenField ID="HiddenField4" Visible="false" runat="server" Value='<%# Eval("cls_reg_id") %>'/>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="cls_reg_code" HeaderText="รหัสวิชา"
                                    ItemStyle-HorizontalAlign="left">
                                    <ItemStyle HorizontalAlign="Left" /> 
                                </asp:BoundField >
                                <asp:BoundField DataField="cls_name" HeaderText="ชื่อวิชา"
                                    ItemStyle-HorizontalAlign="left">
                                    <ItemStyle HorizontalAlign="Left" /> 
                                </asp:BoundField >
                                <asp:BoundField DataField="level" HeaderText="ระดับ"
                                    ItemStyle-HorizontalAlign="left">
                                    <ItemStyle HorizontalAlign="Left" /> 
                                </asp:BoundField >
                                <asp:CommandField ButtonType="Image" HeaderText="แก้ไข" 
                                    ItemStyle-HorizontalAlign="Center" 
                                    SelectImageUrl="~/Pages/images/icon_15.gif" ShowSelectButton="True" >
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:CommandField>
                                <asp:CommandField ButtonType="Image" HeaderText="ลบ" 
                                              ItemStyle-HorizontalAlign="Center" 
                                              SelectImageUrl="~/Pages/images/icon_del.gif"  
                                    ShowDeleteButton="True" DeleteImageUrl="~/Pages/images/icon_del.gif" 
                                    DeleteText="" >
                                              <ItemStyle HorizontalAlign="Center" />
                                          </asp:CommandField>
                            </Columns>
                            <EditRowStyle BackColor="#2461BF" />
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EFF3FB" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#F5F7FB" />
                            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                            <SortedDescendingCellStyle BackColor="#E9EBEF" />
                            <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        </asp:GridView>
                    </td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style37">
                        &nbsp;</td>
                    <td class="style4">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style37">
                        &nbsp;</td>
                    <td class="style20">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style37">
                        &nbsp;</td>
                    <td class="style4">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style37">
                        &nbsp;</td>
                    <td class="style4">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
     <br />
 
</asp:Content>
